<?php

require_once('../../config/maptrick.conf.php');
require_once(SITE_ROOT . 'class/logic/Registration.class.php');
require_once(SITE_ROOT . 'config/session.php');

try {
	if ($_GET["pass"] != SCRIPT_PWD) die("Incorrect password");
	
	$register = new Registration();
	$callback = "http://" . $_SERVER['HTTP_HOST'] . "/index.php";
	$url = $register->authorize($callback);
	header('Location: '. $url);
}
catch (Exception $e) {
	echo $e->getMessage();
}

?>